/* GMCallbackService.js <?php
#   --------------------------------------------------------------
#   GMCallbackService.js 2011-01-24 gambio
#   Gambio GmbH
#   http://www.gambio.de
#   Copyright (c) 2011 Gambio GmbH
#   Released under the GNU General Public License (Version 2)
#   [http://www.gnu.org/licenses/gpl-2.0.html]
#   --------------------------------------------------------------
?>*/
/*<?php
if($GLOBALS['coo_debugger']->is_enabled('uncompressed_js') == false)
{
?>*/
var gm_callback_service=new GMCallbackService();function GMCallbackService(){this.check_callback=function(){$('#gm_callback_service_error_message').load('gm_ajax.php?module=callback_service&check=1'+'&name='+escape($('#gm_callback_service_name').val())+'&telephone='+escape($('#gm_callback_service_telephone').val())+'&vvcode='+$('#gm_callback_service_vvcode').val(),function(errors){if(errors=='')gm_callback_service.send_form();else{$('#gm_callback_service_error_message').html(errors);$('#gm_callback_service_vvcode').val('');$('#gm_callback_service_vvcode_image').html('<img src="gm_create_vvcodes.php?rand='+Math.random()+'&XTCsid='+gm_session_id+'" alt="" />');}});};this.send_form=function(){var inputs=[];$('.callback_service_fields').each(function(){inputs.push(this.name+'='+escape(this.value));});jQuery.ajax({data:inputs.join('&'),url:'gm_ajax.php?module=callback_service',type:"POST",success:function(sent_success){$("#gm_callback_service_success").html(sent_success);}});};}$(document).ready(function(){$("#gm_callback_service_send").click(function(){gm_callback_service.check_callback();return false;});});
/*<?php
}
else
{
?>*/
var gm_callback_service = new GMCallbackService();

function GMCallbackService(){

	this.check_callback = function(){
		$('#gm_callback_service_error_message').load('gm_ajax.php?module=callback_service&check=1'
																		+ '&name=' + escape($('#gm_callback_service_name').val())
																		+ '&telephone=' + escape($('#gm_callback_service_telephone').val())
																		+ '&vvcode=' + $('#gm_callback_service_vvcode').val(),
				function(errors){
					if(errors == '') gm_callback_service.send_form();
					else{
						$('#gm_callback_service_error_message').html(errors);
						$('#gm_callback_service_vvcode').val('');
						$('#gm_callback_service_vvcode_image').html('<img src="gm_create_vvcodes.php?rand=' + Math.random() + '&XTCsid=' + gm_session_id + '" alt="" />');
					}
				}
		);
	}

	this.send_form = function(){
		var inputs = [];

		$('.callback_service_fields').each(function(){inputs.push(this.name + '=' + escape(this.value)); });

		jQuery.ajax({
			data: 		inputs.join('&'),
			url: 			'gm_ajax.php?module=callback_service',
			type: 		"POST",
			success: 	function(sent_success) {
    		$("#gm_callback_service_success").html(sent_success);
  		}
		});
	}

}


$(document).ready(function(){

	$("#gm_callback_service_send").click(function(){
				gm_callback_service.check_callback();

				return false;
			}
		);

});
/*<?php
}
?>*/
